Skip to content

👷 Split unit-bs CI job per browser - #4623

Merged
thomas-lebeau merged 3 commits into
mainfrom
adlrb/split-unit-bs-per-browser
May 27, 2026
Merged

👷 Split unit-bs CI job per browser#4623
thomas-lebeau merged 3 commits into
mainfrom
adlrb/split-unit-bs-per-browser

Conversation

@mormubis

@mormubis mormubis commented May 14, 2026

Copy link
Copy Markdown
Contributor

Motivation

The unit-bs job runs all 5 browsers in a single Karma process. If one browser is unavailable on BrowserStack, the whole job fails and you lose the results from the other 4.

Changes

Each browser now runs as a separate CI job using parallel: matrix. The --browser flag on ci-bs.ts filters the Karma config to a single browser via the BS_BROWSER env var. Without --browser, all 5 browsers run as before.

bs-wrapper.ts used to wait until no BrowserStack build was running at all. Now it checks how many parallel sessions are in use and only waits if all seats are occupied. Each run also gets a unique localIdentifier for BrowserStackLocal so parallel tunnels don't interfere with each other.

Test instructions

BS_BROWSER=edge yarn test:unit:bs        # Only Edge launches
BS_BROWSER=nonexistent yarn test:unit:bs  # Throws with available ids
yarn test:unit:bs                         # All 5 browsers (backwards compat)

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented May 14, 2026

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 169.51 KiB 169.51 KiB 0 B 0.00%
Rum Profiler 5.97 KiB 5.97 KiB 0 B 0.00%
Rum Recorder 21.23 KiB 21.23 KiB 0 B 0.00%
Logs 54.70 KiB 54.70 KiB 0 B 0.00%
Rum Slim 127.85 KiB 127.85 KiB 0 B 0.00%
Worker 22.99 KiB 22.99 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0021 0.0017 -19.05%
RUM - add action 0.0105 0.01 -4.76%
RUM - add error 0.0097 0.0092 -5.15%
RUM - add timing 0.0004 0.0004 0.00%
RUM - start view 0.0092 0.0097 +5.43%
RUM - start/stop session replay recording 0.0007 0.0007 0.00%
Logs - log message 0.0139 0.0139 0.00%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 38.24 KiB 47.49 KiB +9.26 KiB
RUM - add action 64.64 KiB 66.20 KiB +1.57 KiB
RUM - add timing 36.73 KiB 36.78 KiB +46 B
RUM - add error 70.01 KiB 70.96 KiB +979 B
RUM - start/stop session replay recording 45.58 KiB 41.51 KiB -4.07 KiB
RUM - start view 483.88 KiB 482.91 KiB -989 B
Logs - log message 55.00 KiB 56.08 KiB +1.08 KiB

🔗 RealWorld

@datadog-official

datadog-official Bot commented May 14, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 76.96% (+0.18%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 84a9b87 | Docs | Datadog PR Page | Give us feedback!

@mormubis
mormubis force-pushed the adlrb/split-unit-bs-per-browser branch from 533c184 to 61066db Compare May 14, 2026 11:04
Comment thread .gitlab-ci.yml Outdated
@mormubis
mormubis force-pushed the adlrb/split-unit-bs-per-browser branch 8 times, most recently from e0a2b44 to a311531 Compare May 15, 2026 08:14
@mormubis
mormubis marked this pull request as ready for review May 19, 2026 08:26
@mormubis
mormubis requested a review from a team as a code owner May 19, 2026 08:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a311531a23

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread test/unit/karma.bs.conf.js Outdated
Comment thread test/unit/karma.bs.conf.js
Comment thread scripts/test/ci-bs.ts Outdated
Comment thread .gitlab-ci.yml Outdated
Comment thread .gitlab-ci.yml Outdated

@thomas-lebeau thomas-lebeau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, bs-wrapper.ts also checks that there is only one BS job at a time running.

This can make these job wait longer than necessary: (example)

2026-05-15T12:43:32.881957Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:44:02.930861Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:44:32.951962Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:45:03.482930Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:45:33.517166Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:46:03.548156Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:46:33.586724Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:47:03.618851Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:47:33.653588Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:48:03.683845Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:48:33.716840Z 01O �[32;1mOther build running, waiting...�[0m
2026-05-15T12:49:03.758851Z 01O �[32;1mStarting BrowserStackLocal...�[0m

I think there is another BS api that can return you the number of seats occupied, maybe we should use that instead instead of just hasRunningBuild

mormubis added 2 commits May 25, 2026 17:05
Each browser now runs as a separate CI job using parallel: matrix.
The --browser flag on ci-bs.ts filters the Karma config to a single
browser via the BS_BROWSER env var.
Wait for available sessions instead of blocking on any running build.
Isolate tunnels with a unique localIdentifier per run. Add jitter to
the availability check to prevent thundering herd.
@mormubis
mormubis force-pushed the adlrb/split-unit-bs-per-browser branch from be820b4 to 17b291f Compare May 25, 2026 15:09
@mormubis
mormubis requested a review from thomas-lebeau May 25, 2026 15:30
@mormubis
mormubis requested a review from BenoitZugmeyer May 26, 2026 10:21
@thomas-lebeau
thomas-lebeau merged commit 5a795af into main May 27, 2026
28 checks passed
@thomas-lebeau
thomas-lebeau deleted the adlrb/split-unit-bs-per-browser branch May 27, 2026 11:37
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants